<template>
  <ul class="base-tab">
    <li v-for="(item, index) in tabs" :key="item.value" :class="{ active: value === item.value }" @click="$emit('input', item.value)">{{ item.text }}</li>
  </ul>
</template>

<script>
export default {
  name: 'BaseTab',
  props: {
    value: {
      type: String,
    },
    tabs: {
      type: Array,
    },
  },
}
</script>

<style lang="less" scoped>
.base-tab {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-around;
  li {
    height: 30px;
    box-sizing: border-box;
    padding: 0 10px;
    cursor: pointer;
    transform: 0.3s;
    &.active {
      color: #1890ff;
      border-bottom: 2px solid #1890ff;
    }
  }
}
</style>
